package com.kunbo.cn.util.retu;

public class BuildBean<T> {
	
	@SuppressWarnings("hiding")
	public static <T> ResultBean<T> buildResult (ResultBean<T> result,String scode,String fcode,T object) {
		if(null!=object) {
			result.setCode(0);
			result.setMsg(scode);
			result.setData(object);
		}else {
			result.setCode(1);
			result.setMsg(fcode);
			result.setData(null);
		}
		return result;
	}
	
	@SuppressWarnings("hiding")
	public static <T> ResultBean<T> buildResults (ResultBean<T> result,String scode,String fcode,Boolean object) {
		if(object) {
			result.setMsg(scode);
			result.setData(null);
		}else {
			result.setMsg(fcode);
			result.setData(null);
		}
		return result;
	}
}
